package o;

import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.bean.startup.StartupResponse;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.appmarket.service.externalapi.view.ThirdApiActivity;

public class dyp {
    private ThirdApiActivity ˊ;
    private dyn ॱ;

    static class c implements IServerCallBack {
        private dyn ˋ;

        public c(dyn o_dyn) {
            this.ˋ = o_dyn;
        }

        public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
        }

        public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
            StartupResponse startupResponse = (StartupResponse) responseBean;
            if (startupResponse.getResponseCode() != 0 || startupResponse.getRtnCode_() != 0) {
                Logger.ˏ("CheckHmsLogin", "notifyResult  onResult true ");
                this.ˋ.ˊ(true);
            } else if (1 == startupResponse.ˊॱ() || startupResponse.ˊ() == 0) {
                Logger.ˏ("CheckHmsLogin", "notifyResult MUST_LOGIN ");
                this.ˋ.ˊ(true);
            } else {
                Logger.ˏ("CheckHmsLogin", "notifyResult not need login ");
                this.ˋ.ˊ(false);
            }
        }
    }

    public dyp(dyn o_dyn) {
        this.ॱ = o_dyn;
    }

    public void ॱ(ThirdApiActivity thirdApiActivity) {
        this.ˊ = thirdApiActivity;
        if ("com.huawei.appmarket.intent.action.ThirdUpdateAction".equals(thirdApiActivity.getIntent().getAction())) {
            boolean ˋ = eod.ˋ(ContentManager.getInstant().getContext());
            if (ˋ) {
                Logger.ˏ("CheckHmsLogin", "deviceLogined=" + ˋ);
                this.ॱ.ˊ(true);
                return;
            } else if (dof.ˋ(eqp.ॱ())) {
                Logger.ˏ("CheckHmsLogin", "homeCountry is blank");
                this.ॱ.ˊ(true);
                return;
            } else if (eqp.ᐝ()) {
                this.ॱ.ˊ(false);
                return;
            } else {
                Logger.ˏ("CheckHmsLogin", "homeCountry not china");
                ˊ(this.ॱ);
                return;
            }
        }
        Logger.ˏ("CheckHmsLogin", "onResult false");
        this.ॱ.ˊ(false);
    }

    private void ˊ(dyn o_dyn) {
        cfw.ˎ(cvv.ˎ(), new dgw(this.ˊ, o.dgw.c.INVOKE, new c(o_dyn), new dgv(this) {
            final /* synthetic */ dyp ˏ;

            {
                this.ˏ = r1;
            }

            public void ˎ() {
                this.ˏ.ˊ.ʻ();
            }
        }));
    }
}
